package com.lylg.picture_share.service.impl;


import com.lylg.picture_share.dao.CollectMapper;
import com.lylg.picture_share.entity.Collect;
import com.lylg.picture_share.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class CollectServiceImpl  implements CollectService {
    @Autowired
    private CollectMapper collectMapper;

    @Override
    public Collect getCollectImageByUser(Collect collect) {
        return collectMapper.selectCollectImageByUser(collect);
    }

    @Override
    public void cancelCollect(Collect collect) {
        collectMapper.deleteCollect(collect);
    }

    @Override
    public void doCollect(Collect collect) {
        collectMapper.insertCollect(collect);
    }
}
